﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="T_amCharts.aspx.cs" Inherits="Web.T_amCharts" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <title>amCharts 测试</title>

  <link type="text/css" rel="Stylesheet" href="css/right.css" />
  <script type="text/javascript" src="js/jquery.js"></script>
  <script type="text/javascript" src="js/amcharts.js"></script>

  <script type="text/javascript">

    $(function () {

      // Load JSON
      $.get("json/chartData.json", function (data) {

        var json;
        var chartData;
        var chart;
        var legend;

        json = $.parseJSON(data);
        chartData = json.chartData;

        // Pie chart
        chart = new AmCharts.AmPieChart();
        chart.dataProvider = chartData;
        chart.titleField = "text";
        chart.valueField = "value";
        chart.outlineColor = "#FFFFFF";
        chart.outlineAlpha = 0.8;
        chart.outlineThickness = 2;
        chart.sequencedAnimation = false;
        // This makes the chart 3D
        chart.depth3D = 15;
        chart.angle = 60;

        // Legend
        legend = new AmCharts.AmLegend();
        legend.align = "center";
        legend.markerType = "circle";
        chart.addLegend(legend);

        // Write
        chart.write("chartdiv");
      });
    });
  </script>
</head>
<body>
  <div>
  <form id="formMain" runat="server">
    
    <div class="hidden">
      <input id="hdChartData" type="hidden" runat="server" />
    </div>

    <div id="chartdiv" style="width: 50%; height: 362px; margin: 0 auto;"></div>

  </form>
  </div>
</body>
</html>
